from selenium.webdriver.common.by import By

from po_study.Base.Base import Base


class GoodsListPage(Base):
    def __init__(self,driver):
        Base.__init__(self,driver)

    #光标进入菜单内帧
    def into_menu_frame(self):
        self.into_frame('menu-frame')

    # 光标进入主内帧
    def into_main_frame(self):
        self.into_frame('main-frame')

    # 点击菜单列表
    def click_good_list(self):
        self.click((By.LINK_TEXT,'商品列表'))

    # 输入搜索框
    def input_search_text(self):
        self.input((By.NAME,'keyword'),'华为')

    # 点击搜索按钮
    def click_search_button(self):
        self.click((By.XPATH,'/html/body/div[3]/form/input[2]'))

    #选择销售状态（新品）
    def select_by_type(self):
        self.select_by_text((By.NAME, 'intro_type'), '新品')
